export default {
	translate: function(data, config, selected){
		var d = [];
		for(var i=0; i<data.length; i++){	 
			var item = {
				val: data[i][config.val],
				text: data[i][config.text]
			}
			d.push(item);
			 
		}
		if(selected){
			for(var i=0; i<d.length; i++){
				if(d[i].val == selected){
					d[i].selected = 'selected';
				} else {
					delete d[i].selected
				}
			}
		}

		return d;
	}
}